<?php 
class Solvex_Area
{
	const FRONT 	= 'front';
	const ADMIN 	= 'admin';
	const INSTALL 	= 'install';
	
	protected static $_area;
	
	public static function getArea()
	{
		return self::$_area;
	}
	
	public static function setArea($area)
	{
		if(in_array($area, array(self::FRONT,self::ADMIN,self::INSTALL))){
			self::$_area = $area;			
		} else {
			throw new Solvex_Exception("Area $area is illegal");
		}
	}
	
	public static function isFrontend()
	{
		return self::getArea() === self::FRONT;
	}
	
	public static function isBackend()
	{
		return self::getArea() === self::ADMIN;
	}

	public static function isInstaller()
	{
		return self::getArea() === self::INSTALL;
	}
}
?>